package Book;

/***
 * 书籍
 */
public class Book {
    private String name;
    private String author;
    private int price;
    private String type;
    private Boolean isBorrowed = false;


    public Book(String name, String author, int price, String type) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
    }

    public String getName() {
        return name;
    }



    public Boolean getIsBorrow() {
        return isBorrowed;
    }

    public void setBorrowed(Boolean borrowed) {
        this.isBorrowed = borrowed;
    }

    @Override
    public String toString() {
        if(this.isBorrowed){
            return "Book{" +
                    "name='" + name + '\'' +
                    ", author='" + author + '\'' +
                    ", price=" + price +
                    ", type='" + type + '\'' +
                    ",已借出}";
        }else {
            return "Book{" +
                    "name='" + name + '\'' +
                    ", author='" + author + '\'' +
                    ", price=" + price +
                    ", type='" + type + '\'' +
                    ",未借出}";
        }

    }
}
